package routers

import (
	"mypassword/controllers"

	"github.com/beego/beego/v2/server/web"
)

func init() {
	// 登录相关
	web.Router("/api/login", &controllers.LoginController{}, "post:Login")

	// 密钥对相关
	web.Router("/api/keypair/generate", &controllers.KeyPairController{}, "post:Generate")

	// 账号管理相关
	web.Router("/api/accounts", &controllers.AccountController{}, "get:List;post:Create")
	web.Router("/api/accounts/:id", &controllers.AccountController{}, "put:Update;delete:Delete")
	web.Router("/api/accounts/:id/password", &controllers.AccountController{}, "get:DecryptPassword")
}
